package com.cedric.yixianpai.game.cards.Sects.swordCards.a_LianQi;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 云剑·飞刺
 * 5/6/7+3/5/7
 */
@Component
public class Yun_FeiCi extends SwordCard {
    protected int AppendDamage;

    /**
     * 云剑·飞刺 5/6/7+3/5/7
     */
    public Yun_FeiCi(@Value("1") int lvl){
        super("云剑·飞刺");
        this.setCardType(CardType.YUN);
        this.setPeriod(Period.LIANQI);
        this.setDescription("5/6/7攻 连云：追加3/5/7攻");

        if(1==lvl){
            this.setDamage(5);
            this.AppendDamage=3;
            this.setLevel(1);
        }else if(2==lvl){
            this.setDamage(6);
            this.AppendDamage=5;
            this.setLevel(2);
        } else if (3==lvl) {
            this.setDamage(7);
            this.AppendDamage=7;
            this.setLevel(3);
        }else {
            throw new RuntimeException("错误的卡牌等级！");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.attack(Sta2,this.getDamage());
        if(Sta1.getPlayerBuff().getLastUseType()== CardType.YUN){
            Sta1.attack(Sta2,this.AppendDamage);
        }
        Sta1.getPlayerBuff().setSwordIntent(0);
        return true;
    }
}
